<%--
  - Author		:	Jaewon Choi
  - Description	:	
  --%>
<%@ page language="java" %>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/pages/includes/taglibs.jspf" %>
<%@ include file="/WEB-INF/pages/includes/variables.jspf" %>
<%@ include file="/WEB-INF/pages/includes/doctype.jspf" %>
<html>
	<head>
<%@ include file="/WEB-INF/pages/includes/metatags.jspf" %>
		<title><fmt:message key="pages.title" /></title>
		<link rel="stylesheet" type="text/css" href="<c:url value="${dirStyles}/common.css" />" />

		<script type="text/javascript" src="<c:url value="${dirScripts}/jquery-1.7.2.min.js" />"></script>
		<script type="text/javascript">
			$(function(){
			});

			function validation(){
				try{
					for(var i=0;i<document.frm.codes.length;i++){
						if((document.frm.codes[i].value).replace(/\s/g, '') == ""){
							alert("[코드]은 필수 입력 항목입니다.");
							document.frm.codes[i].focus();
							return false;
						}
						
						if((document.frm.viewCodes[i].value).replace(/\s/g, '') == ""){
							alert("[화면코드]은 필수 입력 항목입니다.");
							document.frm.viewCodes[i].focus();
							return false;
						}
						
						if((document.frm.urls[i].value).replace(/\s/g, '') == ""){
							alert("[URL]은 필수 입력 항목입니다.");
							document.frm.urls[i].focus();
							return false;
						}
					}
				}catch(err){
					return false;
				}
				
				return confirm("등록 하시겠습니까?");
			}
		</script>
	</head>
	<body>
		<div class="bodyWrap">
<%@ include file="/WEB-INF/pages/includes/header.jsp" %>
<%@ include file="/WEB-INF/pages/includes/left.jsp" %>
			<div class="contWrap">
				<div class="menuTitle">
					마켓별 버전 관리
				</div>
				<form id="frm" name="frm" method="post" action="<c:url value="/verMngr/submit.do" />" onsubmit="return validation();">
					<table class="frmTbl">
						<colgroup>
							<col width="130px;" />
							<col width="*" />
						</colgroup>
						<tbody>
							<c:forEach items="${verMngrList}" var="verMngr" varStatus="stat">
								<c:if test="${not stat.first}">
									<tr>
										<th colspan="2"></th>
									</tr>
								</c:if>
								<tr>
									<th>마켓</th>
									<td>
										<input type="hidden" name="markets" value="${verMngr.market}" />
										${verMngr.market}
									</td>
								</tr>
								<tr>
									<th>코드</th>
									<td>
										<input type="text" name="codes" maxlength="10" value="${verMngr.code}" />
									</td>
								</tr>
								<tr>
									<th>화면코드</th>
									<td>
										<input type="text" name="viewCodes" maxlength="20" value="${verMngr.viewCode}" />
									</td>
								</tr>
								<tr>
									<th>URL</th>
									<td>
										<input type="text" name="urls" style="width:660px;" maxlength="200" value="${verMngr.url}" />
									</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
					<input type="submit" class="btn" value="등록" />
				</form>
			</div>
<%@ include file="/WEB-INF/pages/includes/footer.jsp" %>
		</div>
	</body>
</html> 